package com.health.system.springSecurity;

import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.core.userdetails.User;

/**
 * 用户信息（用于spring security3）
 * 
 * @author pch 2010.5.25
 * @author bzq update 2011.03.05
 */
public class UserInfo extends User {
	private static final long serialVersionUID = 1L;
	
	/**操作员ID,对应TG_USER_INFO表id_字段*/
	private String userId;
	/**操作员真实姓名,对应TG_USER_INFO表REALNAME_字段*/
	private String userRealname;
	
	/**操作员登录账号,对应TG_USER_INFO表NAME_字段*/
	private String	userName;
	/**
	 * 用户菜单信息
	 */
	private String userMenuInfo;
	/**
	 * 用户Ip地址（在现实菜单时刷新IP信息）
	 */
	private String ip;
	/**
	 * 组织机构代码,对应TG_DATA_ORGANIZATIONS_INFO表CP_CODE_字段
	 */
	private String cpCode;
	/**
	 * 组织机构Id,对应TG_DATA_ORGANIZATIONS_INFO表id_字段
	 */
	private String cpId;
	/**
	 * 用户角色(多个角色以','隔开的)
	 */
	private String role;
	/**
	 * 用户角色中文名(多个角色以','隔开的)
	 */
	private String roleName;
	/**
	 * 公司全称,对应TG_DATA_ORGANIZATIONS_INFO表CP_NAME_字段
	 */
	private String comName;

	/**
	 * 公司简称,对应TG_DATA_ORGANIZATIONS_INFO表ABBREVIATION_字段
	 */
	private String abbreviation;
	/** 1-SI管理系统,2-SI自服系统,3-EC自服务系统,9-其它*/
	String userNature ;
	
	
	/**
	 * 构造函数
	 * @param username 登录名
	 * @param password 登录密码
	 * @param enabled  启动、激活
	 * @param accountNonExpired
	 * @param credentialsNonExpired
	 * @param accountNonLocked
	 * @param authorities
	 * @throws IllegalArgumentException
	 */
	 
	@SuppressWarnings("deprecation")
	public UserInfo(String username, String password, boolean enabled,
			boolean accountNonExpired, boolean credentialsNonExpired,
			boolean accountNonLocked, GrantedAuthority[] authorities)
			throws IllegalArgumentException {
		 
		super(username, password, enabled, accountNonExpired,
				credentialsNonExpired, accountNonLocked, authorities);
	}

	public String getUserMenuInfo() {
		return userMenuInfo;
	}

	public void setUserMenuInfo(String userMenuInfo) {
		this.userMenuInfo = userMenuInfo;
	}

	public String getIp() {
		return ip;
	}

	public void setIp(String ip) {
		this.ip = ip;
	}

	public static long getSerialVersionUID() {
		return serialVersionUID;
	}

	public String getCpCode() {
		return cpCode;
	}

	public void setCpCode(String cpCode) {
		this.cpCode = cpCode;
	}

	public String getCpId() {
		return cpId;
	}

	public void setCpId(String cpId) {
		this.cpId = cpId;
	}

	public String getRole() {
		return role;
	}

	public void setRole(String role) {
		this.role = role;
	}

	public String getRoleName() {
		return roleName;
	}

	public void setRoleName(String roleName) {
		this.roleName = roleName;
	}

	public String getComName() {
		return comName;
	}

	public void setComName(String comName) {
		this.comName = comName;
	}

	public String getAbbreviation() {
		return abbreviation;
	}

	public void setAbbreviation(String abbreviation) {
		this.abbreviation = abbreviation;
	}

	public String getUserId() {
		return userId;
	}

	public void setUserId(String userId) {
		this.userId = userId;
	}

	public String getUserNature() {
		return userNature;
	}

	public void setUserNature(String userNature) {
		this.userNature = userNature;
	}

	public String getUserRealname() {
		return userRealname;
	}

	public void setUserRealname(String userRealname) {
		this.userRealname = userRealname;
	}

	public String getUserName() {
		return userName;
	}

	public void setUserName(String userName) {
		this.userName = userName;
	}

}
